﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using OpenMVCRM.Entities;

namespace OpenMVCRM.ViewModels
{
    public class AddressViewModel : ViewModelBase
    { // will take away
        public string AddressLine1 { set; get; }
        public string AddressLine2 { set; get; }
        public string City { set; get; }
        public string StateName { set; get; }
        public string ZipCode { set; get; }
        public bool IsPrimary { set; get; }

        public string CountryName { set; get;}
        //public virtual Country Country { set; get; }
        //public virtual State State { set; get; }


        public IEnumerable<Country> Countries { set; get; }
        public int SelectedCountryID { set; get; }
        public IEnumerable<State> States { set; get; }
        public int SelectedStateID { set; get; }

        public AddressViewModel()
        {
            if (Countries == null)
                Countries = new List<Country>();

            if (States == null)
                States = new List<State>();


        }

    }
    public class AddClientAddressViewModel
    {
        public int AddressId { set; get; }

        [Required]
        public string AddressLine1 { set; get; }
        public string AddressLine2 { set; get; }
         [Required]
        public string City { set; get; }
        public string StateName { set; get; }
         [Required]
        public string ZipCode { set; get; }
        public bool IsPrimary { set; get; }
        public int ClientId { set; get; }

        public string ClientName { set; get; }

        public IEnumerable<Country> Countries { set; get; }
        public int SelectedCountryID { set; get; }
        public IEnumerable<State> States { set; get; }
        public int SelectedStateID { set; get; }
        

    }

    public class DeleteClientAddressViewModel
    {
        public ClientViewModel Client { set; get; }
        public AddressViewModel AddressToDelete { set; get; }

        public DeleteClientAddressViewModel()
        {
            if (Client == null)
                Client = new ClientViewModel();

            if (AddressToDelete == null)
                AddressToDelete = new AddressViewModel();
        }

    }


}